var t = require;
var e = module;
var o = exports;
var Adv_skd=require("./Adv_skd");
var n =
        (this && this.__extends) ||
        (function () {
            var t = function (e, o) {
                return (t =
                    Object.setPrototypeOf ||
                    ({__proto__: []} instanceof Array &&
                        function (t, e) {
                            t.__proto__ = e;
                        }) ||
                    function (t, e) {
                        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                    })(e, o);
            };
            return function (e, o) {
                function n() {
                    this.constructor = e;
                }
                t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
            };
        })(),
    r =
        (this && this.__decorate) ||
        function (t, e, o, n) {
            var r,
                a = arguments.length,
                i = a < 3 ? e : null === n ? (n = Object.getOwnPropertyDescriptor(e, o)) : n;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, o, n);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (r = t[s]) && (i = (a < 3 ? r(i) : a > 3 ? r(e, o, i) : r(e, o)) || i);
            return a > 3 && i && Object.defineProperty(e, o, i), i;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var a = t("BootConst"),
    i = t("GameData"),
    s = t("Util"),
    c = t("View"),
    l = t("Platforms"),
    u = t("ConfS"),
    p = t("rewards"),
    f = cc._decorator,
    d = f.ccclass,
    h =
        (f.property,
        (function (t) {
            function e() {
                var e = (null !== t && t.apply(this, arguments)) || this;
                return (e.res = "signin"), (e.isMask = !0), (e.zIndex = 2), e;
            }
            return (
                n(e, t),
                (e.prototype.onEnable = function () {
                    Adv_skd.default.instance.showInterstitialAd();
                    7 != i.default.连续签到的次数 ||
                        s.is今天(i.default.上一次签到的时间戳) ||
                        ((i.default.连续签到的次数 = 0), (i.default.连续签到的次数 = i.default.连续签到的次数));
                }),
                (e.prototype.onClick = function (t, e) {
                    switch (t) {
                        case "close":
                            this.hideView();
                            break;
                        case "item":
                            if (s.is今天(i.default.上一次签到的时间戳)) return void s.toast("今天已签到");
                            var o = u.DatasManager.SignDatas[e];
                            if (e == i.default.连续签到的次数) {
                                var n = this.showView(p.default);
                                (n.icon = o.icon),
                                    (n.count = o.Need),
                                    n.callback(this, function (t) {
                                        (i.default.上一次签到的时间戳 = Date.now()),
                                            (i.default.连续签到的次数 += 1),
                                            s.reward(o.Type, o.Need * t, "签到" + t + "倍领取"),
                                            l.default.platformCtrl.dd(a.dd.SignInEvent, {
                                                eventTime: Date.now(),
                                                SignInCount: i.default.连续签到的次数
                                            });
                                    });
                            }
                    }
                }),
                (e = r([d], e))
            );
        })(c.default));
o.default = h;
